getOrElse
inline fun <E> NotEmptyCollection<E>.getOrElse(index: PositiveInt, defaultValue: (PositiveInt) -> E): E
Returns the element at the specified index in this collection, or returns the result of calling the defaultValue function if the index is out of bounds.
Deprecated
The index should be a PositiveInt or a StrictlyPositiveInt.
Replace with
import kotools.types.number.PositiveInt
Content copied to clipboard
this.getOrElse(PositiveInt(index), defaultValue)
Content copied to clipboard
Returns the element at the specified index in this collection, or returns the result of calling the defaultValue function if the index is out of bounds.